/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "GIAI_DAU", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "GiaiDau.findAll", query = "SELECT g FROM GiaiDau g"),
    @NamedQuery(name = "GiaiDau.findById", query = "SELECT g FROM GiaiDau g WHERE g.id = :id"),
    @NamedQuery(name = "GiaiDau.findByTenGiaiDau", query = "SELECT g FROM GiaiDau g WHERE g.tenGiaiDau = :tenGiaiDau"),
    @NamedQuery(name = "GiaiDau.findByQuocGia", query = "SELECT g FROM GiaiDau g WHERE g.quocGia = :quocGia"),
    @NamedQuery(name = "GiaiDau.findByChauLuc", query = "SELECT g FROM GiaiDau g WHERE g.chauLuc = :chauLuc"),
    @NamedQuery(name = "GiaiDau.findByCapDo", query = "SELECT g FROM GiaiDau g WHERE g.capDo = :capDo"),
    @NamedQuery(name = "GiaiDau.findByNgayBatDau", query = "SELECT g FROM GiaiDau g WHERE g.ngayBatDau = :ngayBatDau"),
    @NamedQuery(name = "GiaiDau.findByNgayKetThuc", query = "SELECT g FROM GiaiDau g WHERE g.ngayKetThuc = :ngayKetThuc"),
    @NamedQuery(name = "GiaiDau.findByTheLoai", query = "SELECT g FROM GiaiDau g WHERE g.theLoai = :theLoai"),
    @NamedQuery(name = "GiaiDau.findByGhiChu", query = "SELECT g FROM GiaiDau g WHERE g.ghiChu = :ghiChu")})
public class GiaiDau implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private BigDecimal id;
    @Size(max = 200)
    @Column(name = "TEN_GIAI_DAU")
    private String tenGiaiDau;
    @Size(max = 100)
    @Column(name = "QUOC_GIA")
    private String quocGia;
    @Size(max = 100)
    @Column(name = "CHAU_LUC")
    private String chauLuc;
    @Size(max = 40)
    @Column(name = "CAP_DO")
    private String capDo;
    @Column(name = "NGAY_BAT_DAU")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ngayBatDau;
    @Column(name = "NGAY_KET_THUC")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ngayKetThuc;
    @Size(max = 100)
    @Column(name = "THE_LOAI")
    private String theLoai;
    @Size(max = 2000)
    @Column(name = "GHI_CHU")
    private String ghiChu;
    @OneToMany(mappedBy = "idGiaiDau")
    private List<TranDau> tranDauList;

    public GiaiDau() {
    }

    public GiaiDau(BigDecimal id) {
        this.id = id;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getTenGiaiDau() {
        return tenGiaiDau;
    }

    public void setTenGiaiDau(String tenGiaiDau) {
        this.tenGiaiDau = tenGiaiDau;
    }

    public String getQuocGia() {
        return quocGia;
    }

    public void setQuocGia(String quocGia) {
        this.quocGia = quocGia;
    }

    public String getChauLuc() {
        return chauLuc;
    }

    public void setChauLuc(String chauLuc) {
        this.chauLuc = chauLuc;
    }

    public String getCapDo() {
        return capDo;
    }

    public void setCapDo(String capDo) {
        this.capDo = capDo;
    }

    public Date getNgayBatDau() {
        return ngayBatDau;
    }

    public void setNgayBatDau(Date ngayBatDau) {
        this.ngayBatDau = ngayBatDau;
    }

    public Date getNgayKetThuc() {
        return ngayKetThuc;
    }

    public void setNgayKetThuc(Date ngayKetThuc) {
        this.ngayKetThuc = ngayKetThuc;
    }

    public String getTheLoai() {
        return theLoai;
    }

    public void setTheLoai(String theLoai) {
        this.theLoai = theLoai;
    }

    public String getGhiChu() {
        return ghiChu;
    }

    public void setGhiChu(String ghiChu) {
        this.ghiChu = ghiChu;
    }

    @XmlTransient
    public List<TranDau> getTranDauList() {
        return tranDauList;
    }

    public void setTranDauList(List<TranDau> tranDauList) {
        this.tranDauList = tranDauList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GiaiDau)) {
            return false;
        }
        GiaiDau other = (GiaiDau) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.GiaiDau[ id=" + id + " ]";
    }
    
}
